package com.shrct.businessprocess.customerservice.events;

import com.shrct.businessprocess.customerservice.RCContractInstallInfo;
import com.shrct.businessprocess.customerservice.RCServiceRecord;
import com.shrct.businessprocess.customerservice.events.RCContractInstallInfoEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.events.RCContractInstallInfoEventsManager")
public class RCContractInstallInfoEventsManager extends EntityEventsManager<RCContractInstallInfo> {
  @Autowired(required = false)
  private Collection<RCContractInstallInfoEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCContractInstallInfoEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireSetAsRequired(final RCContractInstallInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).setAsRequired(entity);
    }
    
  }
  
  public void fireSetAsNotRequired(final RCContractInstallInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).setAsNotRequired(entity);
    }
    
  }
  
  public void fireUpdateInfo(final RCContractInstallInfo entity, final Procedure1<? super RCContractInstallInfo> preInit) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).updateInfo(entity,preInit);
    }
    
  }
  
  public void fireCancel(final RCContractInstallInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).cancel(entity);
    }
    
  }
  
  public void fireFinish(final RCContractInstallInfo entity, final Date finishDate) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).finish(entity,finishDate);
    }
    
  }
  
  public void fireDoAddtoServiceRecords(final RCContractInstallInfo entity, final RCServiceRecord serviceRecord) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).doAddtoServiceRecords(entity,serviceRecord);
    }
    
  }
  
  public void fireSendMessage(final RCContractInstallInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCContractInstallInfoEventsListener)listener).sendMessage(entity);
    }
    
  }
}
